ALMaSS  1.0
The Animal, Landscape and Man Simulation System
Newt_Population_Manager.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************************************
3 Copyright (c) 2016, Christopher John Topping, Aarhus University
4 All rights reserved.
5 
6 Redistribution and use in source and binary forms, with or without modification, are permitted provided
7 that the following conditions are met:
8 
9 Redistributions of source code must retain the above copyright notice, this list of conditions and the
10 following disclaimer.
11 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
12 the following disclaimer in the documentation and/or other materials provided with the distribution.
13 
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
15 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
17 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
18 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
19 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 ********************************************************************************************************
23 */
31 //---------------------------------------------------------------------------
32 #ifndef Newt_Population_ManagerH
33 #define Newt_Population_ManagerH
34 //---------------------------------------------------------------------------
35 
36 //---------------------------------------------------------------------------
37 
38 class Newt;
39 
40 //------------------------------------------------------------------------------
41 
47 {
48  public:
50  int age;
52  int x;
54  int y;
56  vector<unsigned> pondrefs;
58  double weight;
64  bool reproinhib;
65 };
66 
72 {
78 public:
79 // Methods
83  virtual ~Newt_Population_Manager (void);
85  void CreateObjects(int ob_type, TAnimal *pvo, struct_Newt* data, int number);
88  return m_BreedingSeasonFlag;
89  }
93  double GetEggDDRateTransformation(double a_temperature) {
97  int temp = int(round(a_temperature));
98  if (temp <= 1) return 0.0;
99  if (temp > 29) return 0.0;
100  return m_NewtEgg_DDTempRate[temp]*a_temperature;
101  }
103  virtual void TheAOROutputProbe();
105  void RecordAdultProduction(int a_adult);
107  void RecordEggProduction(int a_eggs);
109  void RecordMetamorphosis(int a_age);
114 protected:
115 // Attributes
126  // Methods
128  virtual void DoFirst();
131 };
132 
133 #endif
The landscape class containing all environmental and topographical data.
Definition: landscape.h:113
The class to handle all newt population related matters.
Definition: Newt_Population_Manager.h:72
SimpleStatistics m_NewtAdultProdStats
A class for holding the stats on newt adult production.
Definition: Newt_Population_Manager.h:125
virtual void DoFirst()
Things to do before anything else at the start of a timestep
Definition: Newt_Population_Manager.cpp:432
double m_NewtEgg_DDTempRate[31]
An array to hold a precalulated day-degree rate transformation for egg development.
Definition: Newt_Population_Manager.h:119
void InitOutputMetamorphosisStats()
Initialises output mean and variance for meatamorphosis times this year.
Definition: Newt_Population_Manager.cpp:474
int m_BreedingSeasonFlag
Set to 0 when it is newt breeding season, then records the number of days after.
Definition: Newt_Population_Manager.h:117
virtual void TheAOROutputProbe()
Special output functionality.
Definition: Newt_Population_Manager.cpp:451
SimpleStatistics m_NewtMetamorphosisStats
A class for holding the stats on newt metamorphosis development times.
Definition: Newt_Population_Manager.h:121
double GetEggDDRateTransformation(double a_temperature)
Returns the value from the precalulated m_NewtEgg_DDTempRate to get effective day degrees.
Definition: Newt_Population_Manager.h:93
Newt_Population_Manager(Landscape *L)
Newt_Population_Manager Constructor.
Definition: Newt_Population_Manager.cpp:198
void RecordMetamorphosis(int a_age)
Add a new metamorphosis time to the stats record.
Definition: Newt_Population_Manager.cpp:468
void CreateObjects(int ob_type, TAnimal *pvo, struct_Newt *data, int number)
Method for creating a new individual Newt.
Definition: Newt_Population_Manager.cpp:344
void RecordEggProduction(int a_eggs)
Add a new egg production to the stats record.
Definition: Newt_Population_Manager.cpp:462
void SetUnsetBreedingSeason()
Controls when it is breeding season
int IsBreedingSeason()
Returns whether it is breeding season or not.
Definition: Newt_Population_Manager.h:87
SimpleStatistics m_NewtEggProdStats
A class for holding the stats on newt egg production.
Definition: Newt_Population_Manager.h:123
void RecordAdultProduction(int a_adult)
Add a new adult to the stats record.
Definition: Newt_Population_Manager.cpp:456
void SetFreeLivingMortChance()
Calculate the daily background mortality chance based on weather.
Definition: Newt_Population_Manager.cpp:308
void OutputMetamorphosisStats()
Output mean and variance for meatamorphosis times this year.
Definition: Newt_Population_Manager.cpp:481
virtual ~Newt_Population_Manager(void)
Newt_Population_Manager Destructor.
Definition: Newt_Population_Manager.cpp:193
Base class for all population managers.
Definition: PopulationManager.h:424
Definition: PopulationManager.h:324
The base class for all ALMaSS animal classes.
Definition: PopulationManager.h:205
Used for creation of a new Newt object.
Definition: Newt_Population_Manager.h:47
bool reproinhib
Holds a reproductive effect flag.
Definition: Newt_Population_Manager.h:64
double weight
Newt weight.
Definition: Newt_Population_Manager.h:58
vector< unsigned > pondrefs
Born x-coord.
Definition: Newt_Population_Manager.h:56
int y
y-coord
Definition: Newt_Population_Manager.h:54
int age
The newt age.
Definition: Newt_Population_Manager.h:50
int x
x-coord
Definition: Newt_Population_Manager.h:52
Landscape * L
Landscape pointer.
Definition: Newt_Population_Manager.h:60
Newt_Population_Manager * NPM
Newt_Population_Manager pointer.
Definition: Newt_Population_Manager.h:62